import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 查询房产收租计划列表
 * @param query
 * @returns {*}
 */

export const listHouseRentCollectionPlan = (query): AxiosPromise<any> => {
  return request({
    url: '/zichanguanli/rentcollectionplan/list',
    method: 'get',
    params: query
  });
};

/**
 * 新增房产收租计划
 * @param query
 * @returns {*}
 */

export const createHouseRentCollectionPlan = (data): AxiosPromise<any> => {
  return request({
    url: '/zichanguanli/rentcollectionplan',
    method: 'post',
    data
  });
};

/**
 * 修改房产收租计划
 * @param query
 * @returns {*}
 */

export const updateHouseRentCollectionPlan = (data): AxiosPromise<any> => {
  return request({
    url: '/zichanguanli/rentcollectionplan',
    method: 'put',
    data
  });
};

/**
 * 删除房产收租计划
 * @param query
 * @returns {*}
 */

export const deleteHouseRentCollectionPlan = (id): AxiosPromise<any> => {
  return request({
    url: '/zichanguanli/rentcollectionplan/' + id,
    method: 'delete'
  });
};
